<?php echo FlashMessage::getInstance()->display(); ?>

<div class="content-box"><!-- Start Content Box -->
				
	<div class="content-box-header">
		
		<h3>Quản lý dự án</h3>
		
		<ul class="content-box-tabs">

			<li><a href="#tab1" class="default-tab">Danh sách dự án</a></li> <!-- href must be unique and match the id of target div -->
			<li><a href="#tab2">Thêm dự án</a></li>
		</ul>
		
		<div class="clear"></div>
		
	</div> <!-- End .content-box-header -->
	
	<div class="content-box-content">
		
		<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
			
			<form action="<?php echo Route::url('admin-land-list',array('controller' => 'land', 'action' => 'search'))?>">
				<fieldset>
					<p>
						Từ khóa
						<input type="text" name="q" class="text-input small-input"/>
						Địa điểm
						<select name="location">
							<option value="">Tất cả</option>
							<?php foreach($location as $l):?>
							<option value="<?php echo $l->id; ?>"><?php echo $l->name; ?></option>
							<?php endforeach;?>
						</select>
						Loại giao dịch              
						<select name="transaction_type">
							<option value="">Tất cả</option>
							<option value="rent">Cho thuê</option>
							<option value="lease">Cần mua</option>
						</select> 
						
						<input class="button" type="submit" value="Tìm kiếm" />
					</p>
				</fieldset>
			</form>
			
			<?php echo $list->render(); ?>

			
		</div> <!-- End #tab1 -->
		
		<div class="tab-content" id="tab2">
            <?php if(isset($form)): ?>
                <?php echo $form->set('location' , $location)->render(); ?>
            <?php endif; ?>
			
		</div> <!-- End #tab2 -->        
		
	</div> <!-- End .content-box-content -->
	
</div> <!-- End .content-box -->

<script type="text/javascript">
$(function(){
    
    var index = <?php if(Request::current()->action() == 'manage'){ echo 0; }else{ echo 1 ; } ?>;
    
    Sidebar.setActive(Sidebar.menu.project,index);
});
</script>